package com.cxm.weilai.controller;

import com.alibaba.fastjson.JSONObject;
import com.cxm.weilai.result.ResponseInfo;
import com.cxm.weilai.result.ResultInfo;
import com.cxm.weilai.service.FeignService;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: weilai-cloud
 * @description: 用户信息控制层
 * @author: ChenMan
 * @create: 2019-03-26 14:42
 */
@RestController
@RequestMapping(value = "user",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UserController {

  @Value("${server.port}")
  private String port;

  @Autowired
  private FeignService feignService;

  @GetMapping(value = "findUserInfoList")
  public JSONObject findUserInfoList(){
    List list = new ArrayList();
    list.add("alex");
    list.add("lilei");
    list.add(port);
    return ResultInfo.jsonResult(ResponseInfo.SUCCESS);
  }

  @GetMapping(value = "feign")
  public String feign(){
    return feignService.hello("a");
  }

}
